# -*- coding: utf-8 -*-


import requests

url = "http://jwc.wit.edu.cn/"

headers = {"User-Agent":
               "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36",

           # "Connection": "keep-alive",
           # "Accept": "*/*"
           }

response = requests.get(url=url, headers=headers)

if response.status_code == 200:
    print(response.content.decode("utf-8"))

else:
    print(response.status_code)

url2 = url + "info/1020/1854.htm"

print(requests.get(url2, headers=headers).content.decode())

# f = open("test.htm", 'w')
# print(requests.get(url2, headers=headers).content.decode(), file=f)  # 写入文件
# f.close()
